package com.hex.ds.hdrs.calendar.dao;

import com.hex.bigdata.hbda.base.BaseDao;
import com.hex.bigdata.hbda.base.Page;
import com.hex.ds.hdrs.calendar.po.WorkCalendar;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public class WorkCalendarDao extends BaseDao {

   public int insert(WorkCalendar workCalendar){
       return this.insert("com.hex.ds.hdrs.calendar.dao.WorkCalendarDao.insert",workCalendar);
   }


   public List<WorkCalendar> selectAll(Map map, Page page){
       return this.selectPage(WorkCalendar.class,"com.hex.ds.hdrs.calendar.dao.WorkCalendarDao.selectAll",page,map);
    }

    public void del(String pkId) {
        this.delete("com.hex.ds.hdrs.calendar.dao.WorkCalendarDao.del",pkId);
    }

    public WorkCalendar getWorkCalendar(String dateTime) {
        return this.selectOne(WorkCalendar.class,"com.hex.ds.hdrs.calendar.dao.WorkCalendarDao.getWorkCalendar",dateTime);
    }

    public int edit(WorkCalendar workCalendar) {
        return this.update("com.hex.ds.hdrs.calendar.dao.WorkCalendarDao.edit",workCalendar);
    }

    public WorkCalendar checkData(String dateTime) {
        return this.selectOne(WorkCalendar.class,"com.hex.ds.hdrs.calendar.dao.WorkCalendarDao.getWorkCalendar",dateTime);
    }

    public Boolean checkDateStyle(String bizDate){
       return this.selectOne(Integer.class,"com.hex.ds.hdrs.calendar.dao.WorkCalendarDao.checkDateStyle",bizDate)>0;
    }
}